package com.guomao.controller;

import com.guomao.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.guomao.entity.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {
    //    @Autowired
    @Resource
    private OrderService orderService;
//localhost:8080/getOrder?id=1
//localhost:8080/getOrder/1

    @GetMapping("/getOrder/{id}")
    public Order findByID(@PathVariable("id") Long id) {
        return orderService.findById(id);
    }
}